﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.Admin
{
    public partial class Link : BaseCode.BaseAdmin
    {
        BLL.BLL_Link bll = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bll = new BLL.BLL_Link(); 
                this.BindData();
            }
        }

        private void GetAllLink()
        {
        }

        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindData();
        }

        //绑定数据
        void BindData()
        {
            string strWhere = "state > 0";

            System.Data.DataSet ds = bll.GetList(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                this.Repeater1.DataSource = ds;
                this.Repeater1.DataBind();
            }

            AspNetPager1.RecordCount = bll.GetCount(strWhere);
        }

    }
}